//************************************************************************
//   Test1.java     Author: 20172330
// 读取输入的字符串并判断是否过长。
//************************************************************************

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws StringTooLongException {
        final int Num = 20;

        Scanner scan = new Scanner(System.in);

        StringTooLongException problem = new StringTooLongException("You input the too long words.");

        System.out.println("Please enter some words:");
        String string = scan.nextLine();
        if (string.length() > Num)
            throw problem;

        if(string.substring (string.length() - 4, string.length()).equals("DONE" ))
            System.out.println("End of the thing.");


    }
}

